home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue37 / Clinic / MainU.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-08-17  |  1.2 KB  |  63 lines

  1. unit MainU;
  2.  
  3. interface
  4.  
  5. uses
  6.   WinProcs, WinTypes, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  7.   Dialogs, StdCtrls;
  8.  
  9. type
  10.   TMainForm = class(TForm)
  11.     Label1: TLabel;
  12.     Button1: TButton;
  13.     procedure FormCreate(Sender: TObject);
  14.     procedure Button1Click(Sender: TObject);
  15.   private
  16.     { Private declarations }
  17.   public
  18.     { Public declarations }
  19.   end;
  20.  
  21. var
  22.   MainForm: TMainForm;
  23.  
  24. implementation
  25.  
  26. uses OtherU;
  27.  
  28. {$R *.DFM}
  29.  
  30. {$ifdef Ver80} { Delphi 1.0x }
  31.   {$define DelphiLessThan3}
  32. {$endif}
  33. {$ifdef Ver90} { Delphi 2.0x }
  34.   {$define DelphiLessThan3}
  35. {$endif}
  36. {$ifdef Ver93} { C++ Builder 1.0x }
  37.   {$define DelphiLessThan3}
  38. {$endif}
  39. procedure TMainForm.FormCreate(Sender: TObject);
  40. begin
  41. {$ifdef DelphiLessThan3}
  42.   ShowWindow(Application.Handle, sw_Hide);
  43. {$else}
  44.   SetWindowLong(
  45.     Application.Handle, gwl_ExStyle,
  46.     GetWindowLong(Application.Handle, gwl_ExStyle) or ws_Ex_ToolWindow)
  47. {$endif}
  48. end;
  49.  
  50. procedure TMainForm.Button1Click(Sender: TObject);
  51. var
  52.   Loop: Integer;
  53. begin
  54.   { Create and display 10 secondary forms, }
  55.   { but don't bother about storing their object references }
  56.   for Loop := 1 to 10 do
  57.     TOtherForm.Create(Application).Show;
  58.   { Hide main form }
  59.   Hide
  60. end;
  61.  
  62. end.
  63.